﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using SingleUserMall.Orders.VO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SingleUserMall.Dividends.Dividend;
using static SingleUserMall.Items.Item;

namespace SingleUserMall.Items.VO
{
    /// <summary>
    /// 商品
    /// </summary>
    [AutoMapFrom(typeof(Item))]
    public class ItemVO:EntityDto<long>
    {
        internal ItemCategory inItemCategory { get; set; }
        internal RecommendCategory inRecommendCategory { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 图片
        /// </summary>
        public string Picture { get; set; }

        /// <summary>
        /// 是否上架
        /// </summary>
        public bool IsSale { get; set; }
        /// <summary>
        /// 团购标识
        /// </summary>
        public bool IsGroup { get; set; }
        /// <summary>
        /// 团购人数
        /// </summary>
        public int GroupCount { get; set; }
        /// <summary>
        /// 商品分类id
        /// </summary>
        public long ItemCategoryId { get; set; }
        /// <summary>
        /// 商品分类名称
        /// </summary>
        public string ItemCategoryName => inItemCategory?.Name;
        /// <summary>
        /// 推荐分类id
        /// </summary>
        public long? RecommendCategoryId { get; set; }
        /// <summary>
        /// 推荐分类标题
        /// </summary>
        public string RecommendCategoryTitle => inRecommendCategory?.Title;
        /// <summary>
        /// 标签（,分隔）
        /// </summary>
        public string Tags { get; set; }
 
        /// <summary>
        /// 运费
        /// </summary>
        public decimal Freight { get; set; }

        /// <summary>
        /// 包装费
        /// </summary>
        public decimal PackPrice { get; set; }
        /// <summary>
        /// 商品详情
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 月销量
        /// </summary>
        public int MonthSale { get; set; }
        /// <summary>
        /// 总销量
        /// </summary>
        public int TotalSale { get; set; }
        /// <summary>
        /// 发货地
        /// </summary>
        public string Shipments { get; set; }
        /// <summary>
        /// 图片（以,分割）
        /// </summary>
        public string Pictures { get; set; }
        /// <summary>
        /// 店铺id
        /// </summary>
        public int StoreId { get; set; }

        /// <summary>
        ///分红id
        /// </summary>
        public int? DividendId { get; set; }
        /// <summary>
        /// 限时购价格（根据规格设定）
        /// </summary>
        public decimal LimitPrice { get; set; }
        /// <summary>
        /// 限时购标识
        /// </summary>
        public bool IsTimeLimit { get; set; }
        /// <summary>
        /// 限时购开始时间
        /// </summary>
        public DateTime? LimitBeginTime { get; set; }
        /// <summary>
        /// 限时购结束时间
        /// </summary>
        public DateTime? LimitEndTime { get; set; }

        /// <summary>
        /// 砍价开始时间
        /// </summary>
        public DateTime? BargarinBeginTime { get; set; }
        /// <summary>
        /// 砍价结束时间
        /// </summary>
        public DateTime? BargarinEndTime { get; set; }
        /// <summary>
        /// 其他说明
        /// </summary>
        public string Discription { get; set; }
        /// <summary>
        /// 保持零售价标识
        /// </summary>
        public bool IsKeepPrice { get; set; }
        /// <summary>
        /// 是否批发
        /// </summary>
        public bool IsWholesale { get; set; }
        /// <summary>
        /// 最低批发件数
        /// </summary>
        public int MinWholesale { get; set; }
        /// <summary>
        /// 是否置顶
        /// </summary>
        public bool IsPop { get; set; }
        /// <summary>
        /// 虚拟销量可在后台设置
        /// </summary>
        public int VSaleCount { get; set; }
        /// <summary>
        /// 首页标签
        /// </summary>
        public string MainTags { get; set; }
        /// <summary>
        /// 砍价底价
        /// </summary>
        public decimal BargainPrice { get; set; }
        /// <summary>
        /// 需砍价次数
        /// </summary>
        public int BargainTimes { get; set; }
        /// <summary>
        /// 是否砍价
        /// </summary>
        public bool IsBargain { get; set; }
        /// <summary>
        /// 果树总数量
        /// </summary>
        public int? TreeTotalQty { get; set; }

        /// <summary>
        /// 果树剩余数量
        /// </summary>
        public int? TreeRemainingQty { get; set; }
        /// <summary>
        /// 分红期数
        /// </summary>
        public int? NumberPeriods { get; set; }
        /// <summary>
        /// 期限（月）
        /// </summary>
        public int? Timelimit { get; set; }

        /// <summary>
        /// 分红比例
        /// </summary>
        public decimal? DividendAmount { get; set; }
        /// <summary>
        /// 分红类型
        /// </summary>
        public DividendType? DividendTypes { get; set; }
        /// <summary>
        /// 商品类型
        /// </summary>
        public ItemsType? ItemType { get; set; }

        /// <summary>
        /// 分红商品状态 0：未开始分红，1：分红中 ，2：分红完成
        /// </summary>
        public DividendStatus? DividendItemStatus { get; set; }

        /// <summary>
        /// 保底水果公斤数
        /// </summary>
        public int LatestFruitAmount { get; set; }
        /// <summary>
        /// 保底水果名称
        /// </summary>
        public string LatestFruitName { get; set; }
        /// <summary>
        /// 对应果树所在地址
        /// </summary>
        public string TreeAddress { get; set; }
        /// <summary>
        /// 对应最小果树号
        /// </summary>
        public string MinTreeNumber { get; set; }
        /// <summary>
        /// 对应最大果树号
        /// </summary>
        public string MaxTreeNumber { get; set; }
        /// <summary>
        /// 对应果树颗数
        /// </summary>
        public int TreeCount { get; set; }
        /// <summary>
        /// 果树成熟时间
        /// </summary>
        public DateTime? FruitFinishTime { get; set; }
        /// <summary>
        /// 果树剩余颗数
        /// </summary>
        public int LeftTreeCount { get; set; }
        /// <summary>
        /// 购买获得体验金
        /// </summary>
        public decimal Points { get; set; }
        /// <summary>
        /// 是否释放体验金
        /// </summary>
        public bool IsReleasePoints { get; set; }
        /// <summary>
        /// 释放体验金模板Id
        /// </summary>
        public long ReleasePointId { get; set; }
        /// <summary>
        /// 是否已售完
        /// </summary>
        public bool IsSaleOut { get; set; }
    }
}
